package com.xiaoq.coms;

import org.springframework.http.HttpStatus;

public class RestException extends RuntimeException {

	public HttpStatus httpStatus = HttpStatus.INTERNAL_SERVER_ERROR;
	public int errorCode;

	public HttpStatus getHttpStatus() {
		return httpStatus;
	}

	public void setHttpStatus(HttpStatus status) {
		this.httpStatus = status;
	}

	public int getErrorCode() {
		return errorCode;
	}

	public void setErrorCode(int errorCode) {
		this.errorCode = errorCode;
	}

	public RestException(String msg) {
		super(msg);
	}

	public RestException(Throwable throwable) {
		super(throwable);
	}

	public RestException() {
		super();
	}

	public RestException(HttpStatus status) {
		this.httpStatus = status;
	}

	public RestException(HttpStatus status, String message) {
		super(message);
		this.httpStatus = status;
	}

	public RestException(String msg, int errorCode) {
		super(msg);
		this.errorCode = errorCode;
	}

	public RestException(Throwable throwable, int errorCode) {
		super(throwable);
		this.errorCode = errorCode;
	}

	public RestException(HttpStatus status, int errorCode) {
		this.httpStatus = status;
		this.errorCode = errorCode;
	}

	public RestException(HttpStatus status, String message, int errorCode) {
		super(message);
		this.httpStatus = status;
		this.errorCode = errorCode;
	}

}
